package com.johann.test;

import com.johann.classify.BubbleSort;
import com.johann.classify.InsertSort;
import com.johann.classify.SelectionSort;
import com.johann.classify.ShellSort;
import com.johann.util.RandomSeed;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Random;
import java.util.Set;

public class PrintArray {
    public void bubbleTest(){

        Integer[] arr = RandomSeed.randomSeed();
        BubbleSort bbs = new BubbleSort();
        System.out.println("排序前："+Arrays.toString(arr));
        bbs.bubbleSort(arr);
        System.out.println("冒泡排序后："+Arrays.toString(arr));
    }
     public  void  insertTest(){
         Integer[] arr1 = RandomSeed.randomSeed();
         Integer[] arr2 =new Integer[arr1.length];
         for (int i = 0; i < arr1.length; i++) {
             arr2[i]=arr1[i];
         }
         InsertSort ins = new InsertSort();
         System.out.println("排序前："+Arrays.toString(arr1));
         ins.insertSort(arr1);
         System.out.println("插入排序后："+Arrays.toString(arr1));
         System.out.println("===============================");

         InsertSort ins2 = new InsertSort();
         System.out.println("排序前："+Arrays.toString(arr2));
         ins2.insertSort03(arr2);
         System.out.println("插入排序后："+Arrays.toString(arr2));


     }
    public  void  selectTest(){
        Integer[] arr = RandomSeed.randomSeed();
        SelectionSort sls = new SelectionSort();
        System.out.println("排序前："+Arrays.toString(arr));
        sls.selectionSort(arr);
        System.out.println("插入排序后："+Arrays.toString(arr));
    }
    public  void  shellTest(){
        Integer[] arr = RandomSeed.randomSeed();
        ShellSort ss = new ShellSort();
        System.out.println("排序前："+Arrays.toString(arr));
        ss.shellSort(arr);
        System.out.println("插入排序后："+Arrays.toString(arr));
    }


}
